﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.XZYData.Domain.ZSH
{
    /// <summary>
    /// 流程审批实体
    /// </summary>
    [Table("Audit")]
    public class AuditModel
    {
        /// <summary>
        /// 主键，唯一标识
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        /// <summary>
        /// 流程实例id
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string WorkflowId { get; set; } = null!;
        /// <summary>
        /// 步骤id
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string StepId { get; set; } = null!;
        /// <summary>
        /// 步骤名称
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string StepName { get; set; } = null!;
        /// <summary>
        /// 当前审批步骤的执行节点id
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string ExecutePointerId { get; set; } = null!;
        /// <summary>
        /// 审批人id
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public long AuditUserId { get; set; }
        /// <summary>
        /// 审批人名称
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string AuditUserName { get; set; } = null!;
        /// <summary>
        /// 审批意见
        /// </summary>
        [SugarColumn(Length = 300, IsNullable = true)]
        public string? Remark { get; set; }
        /// <summary>
        /// 是否待办
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public bool Status { get; set; }
        /// <summary>
        /// 操作类型 驳回 通过 转办 催办 代办 销毁
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = true)]
        public string? OperationType { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建人ID（关联User.Id）
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int CreatorId { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? ModifyTime { get; set; }

        /// <summary>
        /// 最后修改人ID（关联User.Id）
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int? ModifierId { get; set; }

        /// <summary>
        /// 伪删除标记（false=未删除，true=已删除）
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public bool IsDeleted { get; set; } = false;
    }
}
